//
//  IvrJackDelegate.h
//  IvrJack
//
//  Created by JenanWang on 13-08-11.
//  Copyright 2013 xminnov. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AVFoundation/AVAudioSession.h>

@interface IvrJackService : NSObject {

}

@property(nonatomic, assign) id delegate;
@property (nonatomic,assign) BOOL isCancel;

-(void) open;
-(void) close;
-(void) didEnterBackground;
-(void) didBecomeActive;
//
-(int) readEPC: (BOOL) bStart;
-(int) readEPCTID: (UInt8[]) accessPassword tidData: (UInt8[]) tidData epcData: (UInt8[]) epcData;
-(int) writeTag: (UInt8) block address: (UInt8) address count: (UInt8) count data: (UInt8[]) data;
-(int) selectTag: (UInt8[]) accessPassword epcData: (UInt8[]) epcData epcLength: (int) epcLength;
-(int) readTag: (UInt8) block address: (UInt8) address count: (UInt8) count data: (UInt8[]) data;
-(int) lockTag: (UInt8[]) accessPassword lockObject: (UInt8) lockObject lockAction: (UInt8) lockAction;
-(int) killTag: (UInt8[]) killPassword;
-(int) getBatteryBuzzer: (UInt8[]) data;
-(int) setBuzzer: (BOOL) bBeep;


@end


//IvrJack 状态
typedef enum {
	/**
	 * 状态：正在识别设备
	 */
	ijsDetecting,
	/**
	 * 状态：设备已识别
	 */
	ijsRecognized,
	/**
	 * 状态：设备未识别
	 */
	ijsUnRecognized,
	/**
	 * 状态：设备已拨出
	 */
	ijsPlugout
} IvrJackStatus;

//IvrJack 代理协议的声明
@protocol IvrJackDelegate <NSObject>
	-(void) readerConnect:(NSString *) deviceSN;
	-(void) readerDisconnect;
	-(void) readerStatusChange: (IvrJackStatus) status;
    -(void) onReadTag: (NSString *) epc;
@end
